package com.paipai.es;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Data
@Document(indexName = "woniuround", shards = 3, replicas = 2)
public class RoundES {
    @Id
    private Long id;

    @Field(name = "productid", type = FieldType.Long)
    private Long productid;

    @Field(name = "salerid", type = FieldType.Long)
    private Long salerid;



    @Field(name = "deposit", type = FieldType.Double)
    private BigDecimal deposit;

    @Field(name = "startprice", type = FieldType.Double)
    private BigDecimal startprice;

    @Field(name = "stepprice", type = FieldType.Double)
    private BigDecimal stepprice;

    @Field(name = "finalprice", type = FieldType.Double)
    private BigDecimal finalprice;

    @Field(name = "duration", type = FieldType.Keyword)
    private String duration;

    @Field(type = FieldType.Date)
    private Date starttime;

    @Field(name = "state", type = FieldType.Keyword)
    private String state;

    @Field(name = "lookeramount", type = FieldType.Integer)
    private Integer lookeramount;

    @Field(name = "callamount", type = FieldType.Integer)
    private Integer callamount;

    @Field(name = "pname", analyzer = "ik_max_word", searchAnalyzer = "ik_max_word", type = FieldType.Text)
    private String pname;

    @Field(name = "typeNmae", analyzer = "ik_max_word", searchAnalyzer = "ik_max_word", type = FieldType.Text)
    private String typeNmae;

    @Field(name = "salerName", type = FieldType.Keyword)
    private String salerName;

    @Field(name = "productSrcs", type = FieldType.Auto)
    private List<String> productSrcs;

    @Field(name = "pdetail", analyzer = "ik_max_word", searchAnalyzer = "ik_max_word", type = FieldType.Text)
    private String pdetail;

    @Field(name = "userid", type = FieldType.Long)
    private Long userid;


}
